from rest_framework import routers
from django.urls import path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from . import views
from .views import get_course_structure, get_knowledge_point, record_learning_progress, save_note, get_notes, StudentDashboardAPI, CourseAPI, CourseSelectionAPI, CourseDetailView, StudentLogin, StudentProfileView, CourseProgressAPI, CourseNotesAPI, CourseCollectionsAPI, CourseWrongQuestionsAPI, CourseTabsAPI, CourseTabContentAPI, StudyPlanView

router = routers.DefaultRouter()
router.register(r'notes', views.StudyNoteViewSet)

urlpatterns = [
    path('api/student/login/', views.StudentLogin.as_view(), name='login'),
    path('api/student/profile/', views.StudentProfileView.as_view(), name='student_info'),
    
    path('api/student/course/', views.CourseAPI.as_view()),
    path('api/student/selected-course/', views.CourseSelectionAPI.as_view()),
    path('api/student/course-selection/', views.CourseSelectionAPI.as_view()),
    path('api/student/course/<int:course_id>/selection/', views.CourseSelectionAPI.as_view()),
    
    path('api/student/course/structure/<int:course_id>/', get_course_structure, name='course_structure'),
    path('api/student/course/point/<int:point_id>/', get_knowledge_point, name='knowledge_point'),
    path('api/student/course/learning/', record_learning_progress, name='learning_progress'),
    path('api/student/notes/', save_note, name='save_note'),
    path('api/student/notes/<int:point_id>/', get_notes, name='get_point_notes'),
    path('api/student/notes/', get_notes, name='get_all_notes'),

    path('api/student/course/progress/', views.CourseProgressAPI.as_view(), name='course_progress'),
    path('api/student/course/notes/', views.CourseNotesAPI.as_view(), name='course_notes'),
    path('api/student/course/collections/', views.CourseCollectionsAPI.as_view(), name='course_collections'),
    path('api/student/course/wrong-questions/', views.CourseWrongQuestionsAPI.as_view(), name='course_wrong_questions'),
    path('api/student/course/tabs/', views.CourseTabsAPI.as_view(), name='course_tabs'),
    path('api/student/course/tab-content/', views.CourseTabContentAPI.as_view(), name='course_tab_content'),
    
    path('api/student/dashboard', StudentDashboardAPI.as_view(), name='student_dashboard'),
    
    path('api/student/study-plan/', views.StudyPlanView.as_view(), name='study_plan'),
    path('api/student/study-plan/all/', views.StudyPlanView.as_view(), name='study_plan_all'),
    path('api/student/study-plan/<int:plan_id>/', views.StudyPlanView.as_view(), name='study_plan_detail'),

    path('api/student/course/knowledge-graph/', views.KnowledgeGraphAPI.as_view(), name='course-knowledge-graph'),
    path('api/student/course/<int:course_id>/knowledge-graph/', views.KnowledgeGraphAPI.as_view(), name='course-knowledge-graph-detail'),
    path('api/student/course/<int:course_id>/', views.CourseDetailView.as_view(), name='course-detail'),
]

